﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DevExpress.Xpo;
namespace ChuanPlus
{
    public class Rejection : XPLiteObject
    {
        int fRejectID;
        [Key(true)]
        [Size(10)]
        public int RejectID
        {
            get { return fRejectID; }
            set { SetPropertyValue<int>("RejectID", ref fRejectID, value); }
        }
        DateTime fRejectDate;
        public DateTime RejectDate
        {
            get { return fRejectDate; }
            set { SetPropertyValue<DateTime>("RejectDate", ref fRejectDate, value); }
        }
        Order fDONo;
        [Size(10)]
        public Order DONo
        {
            get { return fDONo; }
            set { SetPropertyValue<Order>("DONo", ref fDONo, value); }
        }
        double fTotal;
        public double Total
        {
            get { return fTotal; }
            set { SetPropertyValue<double>("Total", ref fTotal, value); }
        }
        string fDescription;
        [Size(200)]
        public string Description
        {
            get { return fDescription; }
            set { SetPropertyValue<string>("Description", ref fDescription, value); }
        }
        double fPayoutAmount;
        public double PayoutAmount
        {
            get { return fPayoutAmount; }
            set { SetPropertyValue<double>("PayoutAmount", ref fPayoutAmount, value); }
        }
        Users fCreatedBy;
        public Users CreatedBy
        {
            get { return fCreatedBy; }
            set { SetPropertyValue<Users>("CreatedBy", ref fCreatedBy, value); }
        }
        [Association("Rejection-RejectionDetails")]
        public XPCollection<RejectionDetails> RejectionDetails { get { return GetCollection<RejectionDetails>("RejectionDetails"); } }
        string fStatus;
        public string Status
        {
            get { return fStatus; }
            set { SetPropertyValue<string>("Status", ref fStatus, value); }
        }
        public Rejection(Session session) : base(session) { }
        public Rejection() : base(Session.DefaultSession) { }
        /// <summary>
        /// Initializes a new instance of the Rejection class.
        /// </summary>
        /// <param name="fRejectID"></param>
        /// <param name="fRejectDate"></param>
        /// <param name="fDONo"></param>
        /// <param name="fTotal"></param>
        /// <param name="fDescription"></param>
        /// <param name="fPayoutAmount"></param>
        /// <param name="fCreatedBy"></param>
        public Rejection(DateTime fRejectDate, Order fDONo, double fTotal, string fDescription, double fPayoutAmount, Users fCreatedBy, string fStatus)
        {
            
            this.fRejectDate = fRejectDate;
            this.fDONo = fDONo;
            this.fTotal = fTotal;
            this.fDescription = fDescription;
            this.fPayoutAmount = fPayoutAmount;
            this.fCreatedBy = fCreatedBy;
            this.fStatus = fStatus;
        }
        public override void AfterConstruction() { base.AfterConstruction(); }
    }
}
